
export default (state, action) => {
    state = state || {
        e_width: 0,
        userInfoData: {
            userNm: '',
            avatarColor: ''
        }
    };
    switch (action.type) {
        case 'SET_WIDTH':
            return {
                ...state,
                e_width: action.e_width
            }
        case 'SET_USER_INFO':
            return {
                ...state,
                userInfoData: action.userInfoData
            }
        default:
            return state;
    }
}

export const setWidth = (e_width) => (dispatch) => {
    dispatch({
        type: 'SET_WIDTH',
        e_width: e_width
    })
}
export const setUserInfo = (userInfoData) => (dispatch) => {
    dispatch({
        type: 'SET_USER_INFO',
        userInfoData: userInfoData
    })
}

